import request from 'src/utils/request' // 添加拦截器

/**
 * 前端接口
 * @param {*} url：
 */
// 增加一条装置类型的信息
export function addPropertyType(data) {
    return request({
        url: '/organizer/equipments/types/',
        method: 'post',
        data
    })
}

// 增加一条停机原因的信息
export function addDowntime(data) {
    return request({
        url: '/analysis-mang/labels/',
        method: 'post',
        data
    })
}

// 增加一条工作日历的信息
export function addJob(data) {
    return request({
        url: '/analysis-mang/working-calendar/',
        method: 'post',
        data
    })
}

// 增加一条停机计划的信息
export function addDownPlan(data) {
    return request({
        url: '/analysis-mang/equip/plan/',
        method: 'post',
        data
    })
}

// 增加一条单位的信息
export function addUoms(data) {
    return request({
        url: '/product-mang/uoms/',
        method: 'post',
        data
    })
}

// 增加一条工序的信息
export function addSteps(data) {
    return request({
        url: '/product-mang/steps/',
        method: 'post',
        data
    })
}

// 增加一条产品定义的信息
export function addProduct(data) {
    return request({
        url: '/product-mang/products/',
        method: 'post',
        data
    })
}

// 增加一条工艺路线的信息
export function addRoutes(data) {
    return request({
        url: '/product-mang/routes/',
        method: 'post',
        data
    })
}

// 增加一条客户的信息
export function addCustomers(data) {
    return request({
        url: '/product-mang/customers/',
        method: 'post',
        data
    })
}

// 修改一条装置类型的信息
export function redactPropertyType(id, data) {
    return request({
        url: `/organizer/equipments/types/${id}/`,
        method: 'patch',
        data
    })
}

// 修改一条停机原因的信息
export function redactDownTime(id, data) {
    return request({
        url: `/analysis-mang/labels/${id}/`,
        method: 'patch',
        data
    })
}

// 修改一条工作日历的信息
export function redactJob(id, data) {
    return request({
        url: `/analysis-mang/working-calendar/${id}/`,
        method: 'patch',
        data
    })
}

// 修改一条停机计划的信息
export function redactDownPlan(id, data) {
    return request({
        url: `/analysis-mang/equip/plan/${id}/`,
        method: 'patch',
        data
    })
}

// 修改一条单位的信息
export function redactUoms(id, data) {
    return request({
        url: `/product-mang/uoms/${id}/`,
        method: 'patch',
        data
    })
}

// 修改一条工序的信息
export function redactSteps(id, data) {
    return request({
        url: `/product-mang/steps/${id}/`,
        method: 'patch',
        data
    })
}

// 修改一条产品定义的信息
export function redactProduct(id, data) {
    return request({
        url: `/product-mang/products/${id}/`,
        method: 'patch',
        data
    })
}

// 修改一条工艺路线的信息
export function redactRoutes(id, data) {
    return request({
        url: `/product-mang/routes/${id}/`,
        method: 'patch',
        data
    })
}

// 修改一条客户的信息
export function redactCustomers(id, data) {
    return request({
        url: `/product-mang/customers/${id}/`,
        method: 'patch',
        data
    })
}

// 查询装置类型的列表信息
export function getTableList(query) {
    return request({
        url: '/organizer/equipments/types/list/',
        method: 'get',
        params: query
    })
}

// 查询停机原因的列表信息
export function getDownTableList(query) {
    return request({
        url: '/analysis-mang/labels/list/',
        method: 'get',
        params: query
    })
}

// 查询停机原因的列表信息
export function getJobTableList(query) {
    return request({
        url: '/analysis-mang/working-calendar/list/',
        method: 'get',
        params: query
    })
}

// 查询停机计划的列表信息
export function getDownPlanTableList(query) {
    return request({
        url: '/analysis-mang/equip/plan/list/',
        method: 'get',
        params: query
    })
}

// 查询单位的列表信息
export function getUomsTableList(query) {
    return request({
        url: '/product-mang/uoms/list/',
        method: 'get',
        params: query
    })
}

// 查询工序的列表信息
export function getStepsTableList(query) {
    return request({
        url: '/product-mang/steps/list/',
        method: 'get',
        params: query
    })
}

// 查询产品定义的列表信息
export function getProduceTableList(query) {
    return request({
        url: '/product-mang/products/list/',
        method: 'get',
        params: query
    })
}

// 查询工艺路线的列表信息
export function getRoutesTableList(query) {
    return request({
        url: '/product-mang/routes/list/',
        method: 'get',
        params: query
    })
}

// 查询客户的列表信息
export function getCustomersTableList(query) {
    return request({
        url: '/product-mang/customers/list/',
        method: 'get',
        params: query
    })
}

// 删除一条装置类型的信息
export function deleteType(id) {
    return request({
        url: `/organizer/equipments/types/${id}/`,
        method: 'delete'
    })
}

// 删除一条装置类型的信息
export function deleteDown(id) {
    return request({
        url: `/analysis-mang/labels/${id}/`,
        method: 'delete'
    })
}

// 删除一条装置类型的信息
export function deleteJob(id) {
    return request({
        url: `/analysis-mang/working-calendar/${id}/`,
        method: 'delete'
    })
}

// 删除一条停机计划的信息
export function deleteDownPlan(id) {
    return request({
        url: `/analysis-mang/equip/plan/${id}/`,
        method: 'delete'
    })
}

// 删除一条单位的信息
export function deleteUoms(id) {
    return request({
        url: `/product-mang/uoms/${id}/`,
        method: 'delete'
    })
}

// 删除一条工序的信息
export function deleteSteps(id) {
    return request({
        url: `/product-mang/steps/${id}/`,
        method: 'delete'
    })
}

// 删除一条产品定义的信息
export function deleteProduct(id) {
    return request({
        url: `/product-mang/products/${id}/`,
        method: 'delete'
    })
}

// 删除一条工艺路线的信息
export function deleteRoutes(id) {
    return request({
        url: `/product-mang/routes/${id}/`,
        method: 'delete'
    })
}

// 删除一条客户的信息
export function deleteCustomers(id) {
    return request({
        url: `/product-mang/customers/${id}/`,
        method: 'delete'
    })
}

// 获取问题处理级别配置
export function getLevelList(query) {
    return request({
        url: '/bms/message/level/list/',
        method: 'get',
        params: query
    })
}

// 修改问题处理级别配置
export function modLevel(id, data) {
    return request({
        url: `/bms/message/level/${id}/`,
        method: 'patch',
        data
    })
}

// 获取效率排行榜参数接口
export function getSetup(query) {
    return request({
        url: '/bms/param-setup/',
        method: 'get',
        params: query
    })
}

// 修改效率排行榜参数接口
export function changeSetup(data) {
    return request({
        url: `/bms/param-setup/`,
        method: 'patch',
        data
    })
}

// 查询装置类型图片库信息
export function getImgs(query) {
    return request({
        url: `/organizer/equipments/types/imgs/`,
        method: 'get',
        params: query
    })
}

// 查询机器装置生产配置历史的列表信息
export function getHistoryList(query) {
    return request({
        url: `/organizer/equipments/product/history/list/`,
        method: 'get',
        params: query
    })
}

// 查询工厂鸟瞰位置配置的列表信息
export function getAerialSetList(query) {
    return request({
        url: `/organizer/equipments/aerial-set/list/`,
        method: 'get',
        params: query
    })
}

// 修改效率排行榜参数接口
export function redactAerialSet(id, data) {
    return request({
        url: `/organizer/equipments/aerial-set/${id}/`,
        method: 'patch',
        data
    })
}

// 获取一条休息计划的信息
export function getEquipPlanRest(query) {
    return request({
        url: `/analysis-mang/equip/plan/rest/`,
        method: 'get',
        params: query
    })
}

// 增加一条休息计划的信息
export function addEquipPlanRest(data) {
    return request({
        url: '/analysis-mang/equip/plan/rest/',
        method: 'post',
        data
    })
}

// 修改效率排行榜参数接口
export function redactEquipPlanRest(id, data) {
    return request({
        url: `/analysis-mang/equip/plan/rest/${id}/`,
        method: 'patch',
        data
    })
}

// 删除一条客户的信息
export function deleteEquipPlanRest(id) {
    return request({
        url: `/analysis-mang/equip/plan/rest/${id}/`,
        method: 'delete'
    })
}

// 工厂鸟瞰位置配置批量导入
export function importAerialSet(data) {
    return request({
        url: '/organizer/equipments/aerial-set/batch/',
        method: 'post',
        data
    })
}

// 工厂鸟瞰位置配置批量导入
export function exportAerialSet(query) {
    return request({
        url: '/organizer/equipments/aerial-set/batch/',
        method: 'get',
        params: query
    })
}

// 查询看板库的列表信息
export function getkanbansList(query) {
    return request({
        url: `/bms/kanbans/list/`,
        method: 'get',
        params: query
    })
}

// 增加一条看板库的信息
export function addkanbans(data) {
    return request({
        url: '/bms/kanbans/',
        method: 'post',
        data
    })
}

// 修改一条看板库的信息
export function redactkanbans(id, data) {
    return request({
        url: `/bms/kanbans/${id}/`,
        method: 'patch',
        data
    })
}

// 删除一条看板库的信息
export function deletekanbans(id) {
    return request({
        url: `/bms/kanbans/${id}/`,
        method: 'delete'
    })
}